// 网络请求配置和拦截器
import request from "@/utils/request/index.js"
import store from "@/store/index.js"

request.setConfig({
    baseUrl: store.state.vuex_baseUrl,
    dataType: 'json',
    responseType: 'text', // text、arraybuffer
    header: {
        'content-type': "application/json;charset=utf-8"
    },
});

request.interceptor.request = (config) => {
    // console.log('interceptor.request', store.state.vuex_token); 
    return config;
    // return false; // 取消请求
}

request.interceptor.response = (res) => {
	if(res.code != '200') {
		console.log(res);
	}
    return res; 
}

export default request;